<?php


namespace app\common\model;


use think\Model;

class MaintainModel extends Model {

    // 设备类型分类
    const  DEVICE_CATE = [
        1  => 'PC端',
        2  => 'H5端',
        3 => '安卓端',
        4  => 'IOS端',
    ];


    public static function getDeviceTextAttr($value, $data) {
        return isset(self::DEVICE_CATE[$data['device']]) ? self::DEVICE_CATE[$data['device']] : '';
    }

    public function admin() {
        return $this->hasOne(AdminModel::class, 'id', 'admin_id');
    }

}